﻿using Orchard.ContentManagement.Handlers;
using Orchard.Environment;
using Orchard.Environment.Extensions;
using Orchard.UI.Resources;
using OrchardHUN.QnA.Models;

namespace OrchardHUN.QnA.Handlers
{
    [OrchardFeature("OrchardHUN.QnA")]
    public class QnADiscussionHandler : ContentHandler
    {
        // Injecting IResourceManager directly causes Autofac exception
        public QnADiscussionHandler(Work<IResourceManager> resourceManager)
        {
            OnGetEditorShape<QnADiscussionPart>((context, part) =>
            {
                resourceManager.Value.Include("stylesheet", "~/Modules/OrchardHUN.QnA/Styles/orchardhun-qna.css", "~/Modules/OrchardHUN.QnA/Styles/orchardhun-qna.css");
            });
        }
    }
}